<script lang="ts" setup>
import useTwoDialogStore from '/@/stores/twoDialog'
import pinia from '/@/stores/index';
import OneIcon from '/@/components/Common/OneIcon.vue'
const twoDialogStore = useTwoDialogStore(pinia)
</script>
<template>
    <div v-if="twoDialogStore.list.filter((item: { show: boolean; }) => item.show === false).length" class="toolbar">
        <el-tooltip v-for="item in twoDialogStore.list" :key="item.id" effect="light" :content="item.name" placement="top">
            <transition name="el-fade-in">
                <div v-show="item.show === false" class="icons" @click="twoDialogStore.switchStatus(item.id, true)">
                    <OneIcon v-if="item.icon" :name="item.icon" />
                    <span v-else>{{ item.name.slice(0, 4) }}</span>
                </div>
            </transition>
        </el-tooltip>
    </div>
</template>
<style lang="scss" scoped>
.toolbar {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    z-index: 999;
    width: fit-content;
    bottom: 30px;
    left: 0;
    right: 0;
    margin: auto;
    padding: 10px;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
    border-radius: 50px;

    .icons {
        display: flex;
        justify-content: center;
        align-items: center;
        text-align: center;
        color: #fff;
        width: 50px;
        height: 50px;
        padding: 1em;
        font-size: 12px;
        border-radius: 50%;
        background-color: #409EFF;
        cursor: pointer;
        box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
        transition: all 0.3s ease;
        margin: 0 5px;

        &:hover {
            transform: scale(1.15);
        }
        i {
            font-size: 24px;
        }
    }
}
</style>